<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<link href="http://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<title>已发短消息</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript"
	src="${pageContext.request.contextPath}/OfficeAuto/script/jquery.js"></script>
<script language="javascript"
	src="${pageContext.request.contextPath}/OfficeAuto/script/pageCommon.js"
	charset="utf-8"></script>
<script language="javascript"
	src="${pageContext.request.contextPath}/OfficeAuto/script/PageUtils.js"
	charset="utf-8"></script>
<script language="javascript"
	src="${pageContext.request.contextPath}/OfficeAuto/script/DemoData.js"
	charset="utf-8"></script>
<script language="javascript"
	src="${pageContext.request.contextPath}/OfficeAuto/script/DataShowManager.js"
	charset="utf-8"></script>
<link type="text/css" rel="stylesheet"
	href="${pageContext.request.contextPath}/OfficeAuto/style/blue/pageCommon.css" />

<script type="text/javascript">

function loadname(){
	if(<%=request.getAttribute("error")%>!=null){
		if(<%=request.getAttribute("error")%>){
			alert("发送成功");
		}else{
			alert("发送失败");
		}
		}
	  var html='<table class="table table-striped table-bordered table-hover" id="biao">'
	  html+='<thead><tr> <th>收件人</th> <th>主题</th> <th>内容</th></tr></thead>' 
		
	//创建xmlhttprequest对象
	//$.post("getemail.do",{username:$("#user").val()});
	$.ajax({
		  type: 'POST',
		  url: "${pageContext.request.contextPath}/OfficeAuto/getemail.action",
		  async:true,
		  data: {fajianname:${sessionScpoe.name}},
		  dataType: "json",
		  success:function(data){
			  $("#div1").empty();
			  for(var o in data){
				  html1=' <tbody> <tr> <td>'+data[o].username+'</td><td>'+data[o].zhuti+'</td><td>'+data[o].content+'</td></tr></tbody></table>'
				  $("#div1").append(html+html1); 

			  }
		  }
	})
	setTimeout("loadname()",5000);
	}

</script>
</head>
<body onload="loadname()">

<div id="div1"></div>


</body>
</html>
